const chalk = require('chalk');
const { req } = require('./utils/util');
const https = require("https");
const HttpProxyAgent = require('http-proxy-agent');

const mapi = 'https://api.dev.pajkdc.com/m.api';

let params = {
  headers: {
    'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
  },
  method: "POST",
  // agent: new https.Agent({
  //   rejectUnauthorized: false
  // }),
  body: null
};


(() => {
  // getReportData();
  parseData();
})();

// D8588ED00AFE8A8C374C0A2CE29E90A3B09DC294A652A48C
// 100C210B5E010000000000A7
// DF4248D2E92CD8A6B1FE8682A69AAE3CC0DC8694

function parseData() {
  const data = {
    _mt: 'healthIot.parseData',
    familyId: '2238150939020708',
    height: 170,
    birthDay: '1991-01-01',
    gender: 1,
    originData: '{"hexString":"DF4248D2E92CD80CB11E86A6A69AAEA428FA8694"}',
    deviceSku: 'qingniu-bfs'
  };
  req(data);
}


function getReportData() {
  let data = {
    _mt: 'healthIot.getReport',
    familyId: "87136570908",
    reportId: "r_1563514965467_5_13"
  };
  req(data).catch(err => {
    console.log(chalk.red(err));
  });
}
